{% extends "main/base.html" %}
{% load static i18n %}
{% block title %}{% trans '固定资产类别' %}{% endblock %}
{% block this_css %}
<link type="text/css" href="{% static 'flatlab/css/bootstrap-select.min.css' %}" rel="stylesheet">
{% endblock %}
{% block content %}
<section class="col-lg-5">
    <section class="panel">
        <header class="panel-heading">
            {% trans "固定资产类别列表" %}
        </header>
        <div class="panel-body">
            <table class="table table-striped">
            <thead>
                <tr>
                    <th>{% trans 'No.' %}</th>
                    <th>{% trans '资产类别' %}</th>
                    <th>{% trans '备注' %}</th>{% if perms.main.change_fixedassetstype %}
                    <th></th>{% endif %}
                </tr>
            </thead>
            <tbody>{% for d in fixed_assets_types %}
                <tr>
                    <td>{{ d.id }}</td>
                    <td>{{ d.fixed_assets_type }}</td>
                    <td>{{ d.notes }}</td>{% if perms.main.change_fixedassetstype %}
                    <td align="right">
                        <a href="{% url 'main:change_fixed_assets_type' d.pk %}"><button class="btn btn-success btn-xs"><i class="fa fa-pencil"></i></button></a>
                    </td>{% endif %}
                </tr>{% endfor %}
            </tbody>
        </table>
        </div>
    </section>
</section>
<section class="col-lg-7">
    <section class="panel">
        <header class="panel-heading">
            {% trans "添加固定资产类别" %}
            {% if form.errors %}
            <p>{% trans "您提交的数据有误,请认真检查!" %}</p>
            {% endif %}
            {{ form.non_field_errors }}
        </header>
        <div class="panel-body">
            <form method="post" class="form-horizontal" enctype="multipart/form-data" action="{{ request.path }}?next={{ request.GET.next }}">{% csrf_token %}
                <div class="form-group">
                    <div class="col-lg-2">{{ form.fixed_assets_type.label_tag }}</div>
                    <div class="col-lg-10">{{ form.fixed_assets_type }}{{ form.fixed_assets_type.errors }}</div>
                </div>
                <div class="form-group">
                    <div class="col-lg-2">{{ form.notes.label_tag }}</div>
                    <div class="col-lg-10">{{ form.notes }}{{ form.notes.errors }}</div>
                </div>
                <div class="form-group" align="right">
                    <div class="col-lg-12">
                        <button type="submit" class="btn btn-primary">{% trans "提交" %}</button>
                    </div>
                </div>
            </form>
        </div>
    </section>
</section>
{% endblock %}
{% block this_js %}
<script type="text/javascript" src="{% static 'flatlab/js/bootstrap-select.min.js' %}"></script>
<script type="text/javascript" src="{% static 'flatlab/js/bootstrap-switch.js' %}"></script>
{% endblock %}